package com.nbjtjc.safe.bean.runnable;

import com.nbjtjc.safe.service.danger.DangerInspectService;

import java.util.concurrent.Callable;

/**
 * @auther guqianbin
 * @date 2018/8/6 14:50
 **/
public class InitDangerInspectRunnable implements Callable<Boolean> {

    private int fromCompanyId;
    private int toCompanyId;
    private DangerInspectService dangerInspectService;

    public InitDangerInspectRunnable(int fromCompanyId
            , int toCompanyId, DangerInspectService dangerInspectService) {
        this.fromCompanyId = fromCompanyId;
        this.toCompanyId = toCompanyId;
        this.dangerInspectService = dangerInspectService;
    }

    @Override
    public Boolean call() throws Exception {
        if(!dangerInspectService.copyInspectTableByCompany(fromCompanyId,toCompanyId)){
            return false;
        }
        return true;
    }
}
